<template>
	<view class="box flex column">
		<!-- 顶部 -->
		<view class="header flex column">
			<view class="user paddingTop-20 flex box-sizing paddingLeft-30 paddingRight-30">
				<!-- <view class="flex column flex-center width-80 height-80"> -->
					<!-- <u-avatar :size = "35" :src="src"></u-avatar> -->
					<view class="" style="width: 80rpx;height: 80rpx;border-radius: 50%;">
						<u-upload :fileList="fileList1" @afterRead="afterRead" :deletable="false" name="1" :maxCount="1"
							width="80rpx" height="80rpx">
							<image :src="userInfo.headimg ? userInfo.headimg : userAvatar"
								mode="widthFix" style="width: 80rpx;height: 80rpx;border-radius: 50%; "></image>
							<!-- <u-avatar :size="35" :src="userInfo.headimg ? userInfo.headimg : userAvatar"></u-avatar> -->
							<!-- <u-avatar size = "80rpx" :src="userDetailsInfo.avatar?userDetailsInfo.avatar:src"></u-avatar> -->
						</u-upload>
					</view>
				<!-- </view> -->
				<view @click="details" class="marginLeft-20 info flex column space-between height-80">
					<view class="name fontSize-30 weight-700">
						{{ userInfo.realname ? userInfo.realname : '' }}
					</view>
					<view class="text fontSize-21 color-7b7b7b">
						{{ userInfo.comp_name ? userInfo.comp_name : '百霸书房' }}
					</view>
				</view>
				<view class="icons">
					

				</view>
				<view class="flex" style="flex: 1;justify-content: flex-end;align-items: center;">
					<view class="marginRight-30">
						<u-icon @click="navigateTo('questionClass')" name="question-circle-fill" :size="25"></u-icon>
					</view>
					<u-switch size="20" v-model="userInfo.online" activeColor="#5ac725" inactiveValue="#f56c6c"
						:activeValue="1" :inactiveValue="0" @change="onlineChange" asyncChange
						:loading="onlineLoading"></u-switch>
					<span :class="userInfo.online == 1 ? 'blue' : 'red'" style="margin-left: 10rpx;font-size: 24rpx;">
						{{ userInfo.online == 1 ? '已开工' : '未开工' }}
					</span>
				</view>
			</view>
			<view class="tabs flex box-sizing paddingLeft-30 paddingBottom-30 marginTop-15 relative">
				<!-- <u-icon name="list" :size="15" ></u-icon> -->

				<view v-for="(t, i) in seachList" :key="i" @click="seach(t.id)"
					:class="type == t.id ? 'active' : 'default'"
					class="flex column flex-center items-center  paddingLeft-5 paddingRight-10 fontSize-27 marginLeft-20 color-white borderRadius-5 ">
					{{ t.name }}
				</view>
				<!-- <view @click="seach(0)" :class="type == 0 ? 'active' : 'default'"
					class="flex column flex-center items-center  paddingLeft-5 paddingRight-10 fontSize-27 marginLeft-20 color-white borderRadius-5 ">
					未签到
				</view>
				<view @click="seach(2)" :class="type == 2 ? 'active' : 'default'"
					class="flex column flex-center items-center  paddingLeft-5 paddingRight-10 fontSize-27 marginLeft-20 color-white borderRadius-5 ">
					已签离
				</view> -->
				<view v-if="isRole" @click="addStudent"
					class="flex column flex-center items-center  paddingLeft-5 paddingRight-10 fontSize-27 marginLeft-20 color-white borderRadius-5 "
					style="border: 1rpx solid #a0cfff; color: #a0cfff;">
					添加学员
				</view>
				<view class="absolute onLIne fontSize-25">
					{{ lables[type] }}人数：<span style="color: #ff7a93;"> {{ total }}
					</span>
				</view>

			</view>
		</view>

		<!-- 内容 -->
		<view class="content box-sizing paddingTop-30 paddingBottom-30">
			<!-- 置顶预留 -->
			<view class="">

			</view>
			<scroll-view :refresher-triggered="triggered" scroll-y="true" class="scroll-Y" refresher-enabled
				@refresherrefresh="scrolltoupper()">
				<!-- 列表 -->
				<view v-if="studentList && studentList.length > 0" @click="studentCellClick(it)" class="list-cell "
					v-for="(it, index) in studentList" :key="index">
					<view class="flex column flex-center height-100 relative" @click.stop="isRole?navigateTo(`userDetails?student_id=${it['student_id']}&name=${it['name']}&learn_mode=${it.learn_mode}`):''">
						<u-avatar v-if="it.avatar" :size="40" :src="it.avatar"></u-avatar>
						<u-avatar v-else :size="40" :src="src"></u-avatar>
						<image v-if="it.birth_status == 1" class="absolute birthday" src="../../static/cake.png"
							mode=""></image>
					</view>
					<view style="flex: 1;" class="marginLeft-20 info flex column space-between height-100">
						<view class="name fontSize-27 weight-700">
							{{ it.name }}{{ it.setgrade && it.setgrade.name ? ' - ' + it.setgrade.name : '' }}
						</view>
						<view v-if="!isRole" class="text fontSize-23 color-7b7b7b">
							{{ it.rep_status != 0 ? it.rep_time : '今日暂未添加记录' }}
						</view>
						<view v-if="isRole" class="text fontSize-23 color-7b7b7b">
							{{ type == 0 ? it.create_time||'' : type == 1 ? it.deal_time||'' : it.pay_time||'' }}
						</view>
					</view>
					<view class="" v-if="!isRole && type == 1">
						<view class="countDown" v-if="it.rep_status && it.rep_status > 0 && type != 2">
							<u-count-down :color="it.rep_status == 1 ? '#6fa571' : 'red'"
								:time="parseInt(Math.abs(it.duration)) * 1000"
								:format="it.rep_status == 1 ? '剩余mm分' : '超时mm分'"></u-count-down>
						</view>
						<view class="flex color-7b7b7b center flex-center fontSize-24" v-if="it.rep_time && type != 2">
							{{ '应于' + returnTime(it.rep_time) + '陪学' }}
							<!-- {{$MyUtils.addMinutes(new Date(it.rep_time).getTime(),30)}} -->
						</view>
					</view>
					<view class="rightBtn relative width-100" v-if="!isRole&& type != 1">
						<view @click.stop="timePicker(it)" class="btn">
							签到
						</view>
					</view>
					<!-- 咨询师操作 -->

					<view class="flex">
						<!-- <view class="rightBtn relative width-100" v-if="isRole">
							<view @click.stop="navigateTo(it)" class="btn">
								沟通
							</view>
						</view> -->
						<view class="marginLeft-10 rightBtn relative width-100" :class="type == 1?'marginRight-10':''" v-if="isRole">
							<view @click.stop="type == 0 ? navigateTo(`addOrder?type=add&student_id=${it.student_id}&grade_id=${it.grade_id}`) : navigateTo(`addPay?type=edit&student_id=${it.student_id}&contract_id=${it.contract_id}&owe_fee=${it.owe_fee}`)" class="btn"
								v-if="type == 1 && it.pay_status != 1 || type != 1">
								{{ type == 0 ? '下单' : '缴费' }}
							</view>
							<!-- <view @click.stop="timePicker(it)" class="btn" v-if="type!=1">
								缴费
							</view> -->
						</view>
						<view class="rightBtn relative width-100" v-if="isRole&&type == 1">
							<view @click.stop="navigateTo(`addOrder?type=edit&student_id=${it.student_id}&grade_id=${it.grade_id}&student_attr=${it.student_attr}&contract_id=${it.contract_id}`)" class="btn">
								续签
							</view>
						</view>
					</view>

				</view>
				<view v-if="!studentList || studentList.length == 0" class="flex flex-center items-center"
					style="width: 100%;height: 100%;">
					<u-empty iconSize="60px" mode="search"></u-empty>
				</view>
			</scroll-view>
		</view>
		<view class="popupMask" @touchmove.stop.prevent="moveHandle" v-if="downloadShow">
			<view class="warp">
				<view class="popupDownload">
					<view class="dom">
						<view class="domValue">
							<view class="title">
								{{ '软件更新提示V' + downloadData.version }}
							</view>
							<view class="text" style="margin-top: 42rpx;" v-html="downloadData.versionMark">


							</view>
							<view v-if="!hasProgress"
								@click.stop="hasProgress ? '' : renew(downloadData.isforce, downloadData.packAddress)"
								class="domBtn"> {{ !hasProgress ? '立即更新' : '下载中...' }}</view>
							<view class="" v-else>

							</view>
						</view>
					</view>
				</view>
				<view v-show="downloadIsForce == 0" class="downloadClose" @click="closeDownload">
				</view>
			</view>
		</view>
		<u-datetime-picker confirmColor="#ff5600" :show="timeSelect" v-model="timeVal" mode="time"
			@close="timeSelect = false" @cancel="timeSelect = false" @confirm="singin"></u-datetime-picker>
		<u-action-sheet @select="select" @close="actionClose" cancelText="取消" :actions="list"
			:show="outShow"></u-action-sheet>

		<u-popup :show="leftPopupShow" mode="left" @close="leftPopupShow = false" @open="leftPopupOpen">
			<view class="leftPopupBox">
				<view class="user  flex box-sizing  paddingRight-30">
					<view class="flex column flex-center height-80">
						<!-- <u-avatar :size = "35" :src="src"></u-avatar> -->
						<view class="" style="width: 80rpx;height: 80rpx;border-radius: 50%;overflow: hidden;"
							slot="value">
							<u-upload :fileList="fileList1" @afterRead="afterRead" :deletable="false" name="1"
								:maxCount="1" width="80rpx" height="80rpx">
								<u-avatar :size="35" :src="userInfo.headimg ? userInfo.headimg : src"></u-avatar>
								<!-- <u-avatar size = "80rpx" :src="userDetailsInfo.avatar?userDetailsInfo.avatar:src"></u-avatar> -->
							</u-upload>
						</view>
					</view>
					<view @click="details" class="marginLeft-20 info flex column space-between height-80">
						<view class="name fontSize-30 weight-700">
							{{ userInfo.realname ? userInfo.realname : '' }}
						</view>
						<view class="text fontSize-21 color-7b7b7b">
							{{ userInfo.comp_name ? userInfo.comp_name : '百霸书房' }}
						</view>
					</view>
					<view class="icons">

					</view>
				</view>
				<view class="marginTop-30">
					<u-button size="mini" type="error" @click="tabbarChange(2)" :plain="true" text="退出登录"></u-button>
				</view>
			</view>
		</u-popup>
		<!-- 底部导航 -->
		<!-- <view class="btm"> 
			<u-tabbar
				:border="false"
				:value="defaultTabbar"
				@change="tabbarChange"
				activeColor = "#ff5600"
			>
				<u-tabbar-item v-for="(item,index) in tabbarData" :name="item.id" :key="index" :text="item.name" :icon="item.icon"  ></u-tabbar-item>
			</u-tabbar>
		</view> -->

	</view>
</template>

<script>
const d = new Date()
const year = d.getFullYear()
let month = parseInt(parseInt(d.getMonth()) + 1) > 9 ? parseInt(parseInt(d.getMonth()) + 1) : '0' + parseInt(parseInt(d.getMonth()) + 1)
let day = parseInt(parseInt(d.getDate())) > 9 ? parseInt(parseInt(d.getDate())) : '0' + parseInt(parseInt(d.getDate()))
const h = d.getHours()
let mm = d.getMinutes()
import userAvatar from '@/static/defaultAvatar.png'
export default {
	data() {
		return {
			userAvatar,
			text:'新初一开学，刘睿妈妈想开学前跟赵老师沟通一下，2024.8.21下午来拿书想下午来沟通，看赵老师什么时候有时间？![Deion](http://bbsf.oss-cn-shanghai.aliyuncs.com/admin/202408/202408211557480132429.jpg){{{width="100" height="auto"}}}',
			isRole: false,
			seachList: [],
			studentList: [],
			clueList: [],
			lables: {},
			leftPopupShow: false,
			onlineLoading: false,
			total: 0,
			timeSelect: false,
			timeVal: `${h}:${mm}`,
			downloadShow: false,
			hasProgress: false,
			downloadData: {},
			downloadIsForce: true,
			fileList1: [],
			triggered: false,
			outShow: false,
			list: [
				{
					name: '退出当前账号',
					color: '#ff5600',
				}

			],
			src: userAvatar,
			indexList: ["A", "B", "C"],
			defaultTabbar: 0,
			type: 1,
			tabbarData: [
				{
					id: 0,
					name: '学员',
					icon: 'home',
				},
				// {
				// 	id:1,
				// 	name:'工作台',
				// 	icon:'',
				// },
				{
					id: 2,
					name: '我的',
					icon: 'account',
				}
			],
			studentList: [],
			userInfo: {},
			interval: '',
			getuseronlinTime: '',

		}
	},
	watch:{
		type(val){
			this.total = 0
			this.studentList = []
		}
	},
	onLoad() {
		this.userInfo = uni.getStorageSync('userInfo')
		let userInfo = uni.getStorageSync('userInfo')
		let isRole = userInfo.role_id?userInfo.role_id.search('8'):-1
		console.log(userInfo, userInfo.role_id == '8',isRole, 'userInfouserInfouserInfouserInfo')
		this.isRole = isRole>-1?true:false

		if (this.isRole) {
			this.type = 0
			this.seachList = [
				{
					id: 0,
					name: '未成交'
				},
				{
					id: 1,
					name: '已成交'
				},
				{
					id: 2,
					name: '欠缴费'
				}
			]
			this.lables = {
				'0': '未成交',
				'1': '已成交',
				'2': '欠缴费',
			}
			this.zxInit()
		} else {// 陪学师陪伴师
			this.type = 1

			this.seachList = [
				{
					id: 1,
					name: '已签到'
				},
				{
					id: 0,
					name: '未签到'
				},
				{
					id: 2,
					name: '已签离'
				}

			]
			this.lables = {
				'0': '未签',
				'1': '签到',
				'2': '签离',
			}
			// this.getList()
			this.seach()
			this.getVersion()
			this.getuseronlin()
		}

	},

	onShow() {
		this.getuseronlinTime = setInterval(() => {
			this.getuseronlin()
		}, 60000)
	},
	onHide() {
		console.log('onHide')
		clearInterval(this.interval)
		uni.removeStorageSync('downloadData')
		clearInterval(this.getuseronlinTime)
	},
	methods: {
		// 咨询师方法集
		zxInit() {
			this.type = 0
			this.seach(0)
			// if (this.type == 0) {
			// 	// 学员列表
			// 	this.studentIndex()
			// } else {
			// 	// 订单
			// 	this.clueIndex()
			// }



		},
		studentIndex() {
			this.$home.studentIndex().then(res => {
				this.total = res.total
				this.studentList = res.data
				uni.hideLoading()
				this.triggered = false
				console.log(res, 'iiiiiiiiiiiiiii')
			}).catch(err => {
				uni.hideLoading()
				this.triggered = false
			})
		},
		clueIndex() {
			this.$home.clueIndex({ owefee: this.type }).then(res => {
				this.total = res.total
				this.studentList = res.data
				uni.hideLoading()
				this.triggered = false
			}).catch(err => {
				uni.hideLoading()
				this.triggered = false

			})
		},
		// 调整
		navigateTo(url) {
			console.log(url, 'ooooooooo')
			uni.navigateTo({
				url: '/pages/index/'+url,
			})
		},

		updateState() {

		},
		addStudent() {
			uni.navigateTo({
				url: '/pages/index/addStudent'
			})
		},
		getuseronlin() {
			this.$home.getuseronlin().then((res) => {
				if (res.status == 200) {
					if (res.online && this.userInfo.online == res.online) return
					this.userInfo.online = parseInt(res.online)
					uni.setStorageSync('userInfo', JSON.parse(JSON.stringify(this.userInfo)));
				}
			})
		},
		scrolltoupper() {
			this.triggered = true
			this.seach(this.type)
		},
		// 开工下线
		onlineChange(e) {
			let that = this
			uni.showModal({
				content: e ? '确定要开工吗？' : '确定要下线吗？',
				confirmText: e ? '开工' : '下线',
				cancelText: '取消',
				success: (res) => {
					if (res.confirm) {
						that.onlineLoading = true
						that.online(e)
					}
				}
			})
		},
		online(e) {
			// setTimeout(()=>{
			// 	this.onlineLoading = false
			// 	this.userInfo.online = e?1:0
			// 	uni.setStorageSync('userInfo',JSON.parse(JSON.stringify(this.userInfo)));
			// },1000)
			// return
			this.$home.online({ online: e ? 1 : 0 }).then(res => {
				console.log(res, 111)
				if (res && res.online == '0' || res && res.online == '1') {
					this.userInfo.online = parseInt(res.online)
					uni.setStorageSync('userInfo', JSON.parse(JSON.stringify(this.userInfo)));
				}
				this.onlineLoading = false
				uni.showToast({
					title: res.msg,
					icon: 'none'
				})
			}).catch(err => {
				setTimeout(() => {
					this.onlineLoading = false
				}, 1000)
			})
		},
		getVersion() {
			//#ifdef APP-PLUS
			// this.version=plus.runtime.versionCode
			// 获取本地应用资源版本号
			plus.runtime.getProperty(plus.runtime.appid, (info) => {
				let downloadData = {}
				uni.request({
					// 正式环境更新信息
					url: 'http://bbsf.naomishu.cn/appversion/version.txt',
					// 开发环境更新信息
					// url: 'https://api.naomishu.cn/static/devversion.txt',
					// 测试环境更新信息
					// url:'https://api.naomishu.cn/static/testversion.txt',
					success: (res) => {
						uni.setStorageSync('versionInfo', res.data)
						if (res.statusCode == 200) {
							downloadData = res.data
							if (res.data.isForceVersion) {
								if (Number(res.data.versionCode) != info.versionCode) {
									uni.setStorageSync('downloadData', downloadData)
									this.downloadShow = true
									this.downloadIsForce = downloadData.isforce
									this.downloadData = downloadData
								} else {
									uni.removeStorageSync('downloadData')
								}
							} else {
								if (Number(res.data.versionCode) > info.versionCode) {
									uni.setStorageSync('downloadData', downloadData)
									this.downloadShow = true
									this.downloadIsForce = downloadData.isforce
									this.downloadData = downloadData
								} else {
									uni.removeStorageSync('downloadData')
								}
							}

							// if(Number(info.versionCode) != Number(res.data.versionCode)){
							// 	uni.setStorageSync('downloadData',downloadData)
							// }
						}
					}
				})
				// this.versionCode = info.versionCode ;
			})
			//#endif 
		},
		// 更新版本
		renew(isShowCancel, url) {
			this.hasProgress = true
			uni.showLoading({
				title: "更新中"
			})
			const downloadTask = uni.downloadFile({
				url: url, // 这个是最新版本apk包的地址
				success: (res) => {
					uni.hideLoading();
					if (res.statusCode === 200) {
						plus.runtime.install(res.tempFilePath, {
							force: true
						}, _res => {
							plus.runtime.restart();
							uni.hideToast();
							uni.hideLoading()
							this.hasProgress = false
						});
					} else {
						this.hasProgress = false
						uni.hideLoading()
						uni.showToast({
							title: "下载失败！",
							icon: "none",
							duration: 800,
						});
					}
				},
				fail: (err) => {
					uni.showToast({
						title: "下载失败！",
						icon: "none",
						duration: 800,
					});
					uni.hideLoading()

				}
				// 接口调用结束
				//  complete: () => {
				// downloadTask.offProgressUpdate(); //取消监听加载进度
				//  };
				//  downloadTask.onProgressUpdate(res => {
				// 	state.percent = res.progress;
				// 	console.log(\'下载进度百分比:\' + res.progress); // 下载进度百分比
				// 	console.log(\'已经下载的数据长度:\' + res.totalBytesWritten); // 已经下载的数据长度，单位 Bytes
				// 	console.log(\'预期需要下载的数据总长度:\' + res.totalBytesExpectedToWrite); // 预期需要下载的数据总长度，单位 Bytes
				// });
			});
		},
		// 禁止滚动空函数
		moveHandle() {

		},
		closeDownload() {
			this.downloadShow = false;
			uni.setStorageSync('downloadDataShow', false);
			uni.removeStorageSync('downloadData')
		},
		// 删除图片
		deletePic(event) {
			this[`fileList${event.name}`].splice(event.index, 1)
		},
		// 新增图片
		async afterRead(event) {
			// 当设置 multiple 为 true 时, file 为数组格式，否则为对象格式
			let lists = [].concat(event.file)
			let fileListLen = this[`fileList${event.name}`].length
			lists.map((item) => {
				this[`fileList${event.name}`].push({
					...item,
					status: 'uploading',
					message: '上传中'
				})
			})
			for (let i = 0; i < lists.length; i++) {
				const result = await this.uploadFilePromise(lists[i].url)
				this.setUpAvatar(result)
				let item = this[`fileList${event.name}`][fileListLen]
				this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
					status: 'success',
					message: '',
					url: result
				}))
				fileListLen++
			}
		},
		uploadFilePromise(url) {
			return new Promise((resolve, reject) => {
				let a = uni.uploadFile({
					url: this.$uploadUrl+'Upload/upload', // 仅为示例，非真实的接口地址
					// url: 'http://bbsf.test/api/Upload/upload', // 仅为示例，非真实的接口地址
					filePath: url,
					name: 'file',
					formData: {
						upload_config_id: 1
					},
					header: {
						token: uni.getStorageSync('token'),
						// 'content-type': 'multipart/form-data'
					},
					success: (res) => {
						resolve(JSON.parse(res.data).data)
					},
					fail: (err) => {
						// console.log(err,999)
					}
				});
			})
		},
		editAvatar() {
			let that = this
			uni.chooseImage({
				count: 6, //默认9
				sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
				success: function (res) {
					that.userDetailsInfo.avatar = res.tempFilePaths
					// console.log(JSON.stringify(res.tempFiles));
				}
			});
		},
		setUpAvatar(url) {
			this.$home.terUpavatar({ user_id: this.userInfo.user_id, headimg: url }).then((res) => {
				if (res.status == 200) {
					this.userDetailsInfo.avatar = url
					uni.showToast({
						title: '修改成功！',
						icon: 'none'
					})
				} else {
					this.fileList1 = []
				}
			})
		},
		returnTime(date) {
			let time = new Date(date).getTime()
			let newDate = new Date(parseInt(time) + 30 * 60 * 1000)
			// let year = newDate.getFullYear();
			// let month = newDate.getMonth() + 1;
			// let day = newDate.getDate();
			let hour = newDate.getHours();
			let minute = newDate.getMinutes() > 10 ? newDate.getMinutes() : '0' + newDate.getMinutes();
			// let second = newDate.getSeconds();
			return hour + ':' + minute
		},
		seach(type = 1) {
			uni.showLoading()
			this.type = type
			if (this.isRole) {
				// this.zxInit()
				if (this.type == 0) {
					// 学员列表
					this.studentIndex()
				} else {
					// 订单
					this.clueIndex()
				}
			} else {
				this.getList()
				clearInterval(this.interval)
				this.interval = setInterval(() => {
					this.getList()
				}, 10000)
			}

		},
		getList() {
			let that = this
			this.$home.home({ sign_status: this.type }).then(res => {
				this.studentList = res.data
				this.total = res.total
				setTimeout(() => {
					that.$nextTick(() => {
						uni.stopPullDownRefresh()
						that.triggered = false
						uni.hideLoading()
					})
				}, 300)
			}).catch(err => {
				setTimeout(() => {
					that.$nextTick(() => {
						uni.stopPullDownRefresh()
						that.triggered = false
						uni.hideLoading()
					})
				}, 300)
			})
		},
		// 员工详情左侧弹窗
		details() {
			this.leftPopupShow = true
		},
		// 员工详情左侧弹窗打开回调
		leftPopupOpen() {

		},
		tabbarChange(e) {
			if (this.defaultTabbar == e) return
			if (e == 2 || e == 1) {
				this.leftPopupShow = false
				this.outShow = true

			} else {
				this.defaultTabbar = e
			}

		},
		studentCellClick(e) {
			// uni.navigateTo({
			// 	url:'/pages/index/studentRecord?student_id='+e.student_id
			// })
			// return 
			if(this.isRole){
				if(this.type == 0 ){
					uni.navigateTo({
						url: `/pages/index/userDetails?student_id=${e['student_id']}&name=${e['name']}&learn_mode=${e.learn_mode}`
					})
				}else{
					uni.navigateTo({
						url: `/pages/index/pay?contract_id=${e.contract_id}&name=${e['name']}&e=${e.student_id}`
					})
				}
				
			}else{
				if (e && e.student_id) {
					uni.navigateTo({
						url: '/pages/index/studentRecord?student_id=' + e.student_id + `&name=${e.name}&learn_mode=${e.learn_mode}`
					})
				}
			}
			
		},
		select(e) {
			if (e.name == "退出当前账号") {
				uni.removeStorageSync('mobile')
				uni.removeStorageSync('pwd')
				uni.removeStorageSync('token')
				uni.removeStorageSync('userInfo')
				uni.reLaunch({
					url: '/pages/login/login'
				})
			}
		},
		actionClose() {
			this.outShow = false
			this.leftPopupShow = true
		},
		timePicker(it) {
			this.student_id = it.student_id
			this.timeSelect = true
		},
		singin(it) {
			let time = year + '-' + month + '-' + day + ' ' + it.value + ':00'
			this.$home.singin({ student_id: this.student_id, signin_time: time }).then((res) => {
				if (res.status == 200) {
					uni.showToast({
						title: '签到成功！',
						icon: 'none'
					})
					this.getList()
				}
			})
		}

	}
} 
</script>

<style lang="scss">
.box {
	width: 100vw;
	height: 100vh;

	.leftPopupBox {
		width: 100%;
		min-width: 450rpx;
		height: 100%;
		// background-color: #5ac725;
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		padding: calc(var(--status-bar-height) + 30rpx) 30rpx 30rpx;
	}

	.blue {
		color: #5ac725;
	}

	.red {
		color: #f56c6c;
	}

	.info {
		display: flex;

	}

	.rightBtn {
		display: flex;
		justify-content: center;
		align-items: center;
		height: 100rpx;
	}

	.btn {

		height: 50rpx;
		width: 100%;
		color: #ff5600;
		border-radius: 6rpx;
		background-color: #fff;
		border: 1rpx solid #ff5600;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.active {
		border: 1rpx solid #fff;
		color: #fff;
		background-color: #ff5600;
	}

	.default {
		border: 1rpx solid #ff5600;
		color: #ff5600;
		background-color: #fff;
	}

	.header {
		width: 100%;
		// min-height: 220rpx;
		box-sizing: border-box;
		padding-top: var(--status-bar-height);
		background-color: #fff;
	}

	.user {}

	.scroll-Y {
		width: 100%;
		height: calc(100vh - 180rpx - 84px);
	}

	.birthday {
		width: 36rpx;
		height: 36rpx;
		bottom: 0rpx;
		right: 0rpx;
	}

	.onLIne {
		top: 3rpx;
		right: 52rpx;
	}

	.content {
		width: 100%;
		flex: 1;
		min-height: calc(100vh - 180rpx - 84px);

		// overflow-y: auto;
		.list-cell {
			display: flex;
			box-sizing: border-box;
			width: 100%;
			padding: 20rpx 30rpx;
			overflow: hidden;
			color: #323233;
			font-size: 14px;
			line-height: 24px;
			background-color: #fff;

			&:nth-child(odd) {
				background-color: #f7f7f7;
			}

			.countDown {
				width: 160rpx;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				font-size: 24rpx;
				color: beige;

				.u-count-down__text {
					// color:#6fa571;
					font-size: 24rpx;
				}
			}
		}
	}

	.btm {
		width: 100%;
		height: 84px;
	}
}

.popupMask {
	width: 100vw;
	height: 100vh;
	position: fixed;
	background-color: rgba(0, 0, 0, 0.4);
	box-sizing: border-box;
	z-index: 99999;
}

.warp {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	flex-direction: column;

	.popupDownload {
		width: 100vw;
		height: 900rpx;
		padding: 0 78rpx;
		box-sizing: border-box;

		.dom {
			width: 100%;
			height: 100%;
			background: url('https://bbfnimage.oss-cn-shanghai.aliyuncs.com/bbyeIconImage/img/downloadBj.png') no-repeat;
			background-size: 100% 100%;
		}

		.domValue {
			width: 100%;
			height: 100%;
			padding: 0 70rpx;
			box-sizing: border-box;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			text-align: center;
			position: relative;

			.title {
				margin-top: 100rpx;
				font-size: 34rpx;
				font-family: PingFang SC-Medium, PingFang SC;
				font-weight: 500;
				color: #091C30;
			}


			.text {
				text-align: left;
				font-size: 28rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				color: #858F99;
			}

		}

		.domBtn {
			position: absolute;
			bottom: 93rpx;
			left: 60rpx;
			right: 60rpx;
			// height: 80rpx;
			background: linear-gradient(90deg, #FF8C8E 0%, #FF2E2D 100%);
			border-radius: 40rpx 40rpx 40rpx 40rpx;
			color: #fff;
			text-align: center;
			line-height: 80rpx;
		}
	}

}

.downloadClose {
	margin-top: 32rpx;
	width: 112rpx;
	height: 112rpx;
	background: url('https://bbfnimage.oss-cn-shanghai.aliyuncs.com/bbyeIconImage/img/downloadClose.png') no-repeat;
	background-size: 100% 100%;
}
</style>
